<?php
require('init.php');
@$user_name=$_REQUEST['uname'];
if($user_name===null || $user_name===""){
  die("用户名不能为空");
}
@$user_pwd=$_REQUEST['upwd'];
if($user_pwd===null ||$user_pwd===""){
    die("密码不能为空");
  }
@$user_email=$_REQUEST['uemail'];
if($user_email===null || $user_email===""){
    die("邮箱不能为空");
  }
@$user_phone=$_REQUEST['uphone'];
if($user_phone===null || $user_phone===""){
    die("用户名不能为空");
}
$sql="INSERT INTO user(uname,upwd,email,phone) VALUES ('$user_name','$user_pwd','$user_email','$user_phone')";
$result=mysqli_query($conn,$sql);
if($result===false){
    echo "添加失败";
}else{
    echo "添加成功";
    $uid = mysqli_insert_id($conn);
	echo "新用户在数据库中的编号为：$uid";
}